﻿@{
    var pagingCount = PageData[0];
    var page = PageData[1];
    var url = PageData[2];
    var query = PageData[3];
}

<div class="pagination">
    <ul>
        <li><a href="@url?p=1@(query)" title="Đầu trang">«</a></li>
        @for (int j = page - 3; j <= page + 3; j++)
        {
            if (j > 0 && j <= pagingCount)
            {
                if (j == page)
                {
            <li class="active"><a href="@url?p=@j@query" title="Trang @j">@j</a></li>
                }
                else
                {
            <li><a href="@url?p=@j@query" title="Trang @j">@j</a></li>
                }

            }
        }
        <li><a href="@url?p=@pagingCount@query" title="Cuối trang">»</a></li>
    </ul>
</div>
